package com.fr.data.core.define;

import com.fr.base.XMLable;
import com.fr.base.core.ComparatorUtils;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;

public class XMLColumnNameType
  implements XMLable
{
  protected int type = -1;
  private String name = null;

  public String getName()
  {
    return this.name;
  }

  public void setName(String paramString)
  {
    this.name = paramString;
  }

  public XMLColumnNameType()
  {
  }

  public XMLColumnNameType(String paramString, int paramInt)
  {
    this.name = paramString;
    this.type = paramInt;
  }

  public int getType()
  {
    return this.type;
  }

  public void setType(int paramInt)
  {
    this.type = paramInt;
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isChildNode())
    {
      String str;
      if ("Name".equals(paramXMLableReader.getTagName()))
        if ((str = paramXMLableReader.getElementValue()) != null)
          this.name = str.trim();
      else if ("Type".equals(paramXMLableReader.getTagName()))
        if ((str = paramXMLableReader.getElementValue()) != null)
          this.type = Integer.parseInt(str);
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("Name").textNode(this.name).end();
    paramXMLPrintWriter.startTAG("Type").textNode(String.valueOf(getType())).end();
  }

  public boolean equals(Object paramObject)
  {
    return ((paramObject instanceof XMLColumnNameType) && (ComparatorUtils.equals(this.name, ((XMLColumnNameType)paramObject).name)) && (this.type == ((XMLColumnNameType)paramObject).type));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    XMLColumnNameType localXMLColumnNameType = (XMLColumnNameType)super.clone();
    return localXMLColumnNameType;
  }
}